package riot.challenge.java.tests;

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

import riot.challenge.java.interfaces.IPlayerGameStatistics;
import riot.challenge.java.statistics.PlayerGameStatistics;

public class PlayerGameStatisticsTests {

	IPlayerGameStatistics pgst;
	int expected;
	int actual;
	int delta;
	
	@Before 
	public void init() {
		pgst = new PlayerGameStatistics();
		expected = 0;
		actual = -1;
		delta = 0;
	}

	@Test
	public final void testGetNumberOfAttemptedAttacks() {
		actual = pgst.getNumberOfAttemptedAttacks();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetNumberOfAttemptedAttacks() {
		expected = 2;
		pgst.setNumberOfAttemptedAttacks(expected);
		actual = pgst.getNumberOfAttemptedAttacks();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetNumberOfHits() {
		actual = pgst.getNumberOfHits();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetNumberOfHits() {
		expected = 2;
		pgst.setNumberOfHits(expected);
		actual = pgst.getNumberOfHits();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetTotalAmountOfDamageDone() {
		actual = pgst.getTotalAmountOfDamageDone();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetTotalAmountOfDamageDone() {
		expected = 2;
		pgst.setTotalAmountOfDamageDone(expected);
		actual = pgst.getTotalAmountOfDamageDone();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetNumberOfKills() {
		actual = pgst.getNumberOfKills();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetNumberOfKills() {
		expected = 2;
		pgst.setNumberOfKills(expected);
		actual = pgst.getNumberOfKills();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetNumberOfFirstHitKills() {
		actual = pgst.getNumberOfFirstHitKills();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetNumberOfFirstHitKills() {
		expected = 2;
		pgst.setNumberOfFirstHitKills(expected);
		actual = pgst.getNumberOfFirstHitKills();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetNumberOfAssists() {
		actual = pgst.getNumberOfAssists();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetNumberOfAssists() {
		expected = 2;
		pgst.setNumberOfAssists(expected);
		actual = pgst.getNumberOfAssists();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetNumberOfSpellsCast() {
		actual = pgst.getNumberOfSpellsCast();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetNumberOfSpellsCast() {
		expected = 2;
		pgst.setNumberOfSpellsCast(expected);
		actual = pgst.getNumberOfSpellsCast();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetTotalSpellDamageDone() {
		actual = pgst.getTotalSpellDamageDone();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetTotalSpellDamageDone() {
		expected = 2;
		pgst.setTotalSpellDamageDone(expected);
		actual = pgst.getTotalSpellDamageDone();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetTotalTimePlayed() {
		long actual2 = pgst.getTotalTimePlayed();
		assertEquals(expected, actual2, delta);
	}

	@Test
	public final void testSetTotalTimePlayed() {
		long expected2 = 2000;
		pgst.setTotalTimePlayed(expected2);
		long actual2 = pgst.getTotalTimePlayed();
		assertEquals(expected2, actual2, delta);
	}

}
